home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cdecl.zip / CDECL.MAN < prev    next >
Text File  |  1987-10-21  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4.      CCCCDDDDEEEECCCCLLLL((((1111))))                  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                  CCCCDDDDEEEECCCCLLLL((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           cdecl - Compose C declarations
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ccccddddeeeeccccllll
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.           _C_d_e_c_l is a program for encoding and decoding C type-
  16.           declarations.  It reads standard input for statements in the
  17.           language described below.  The results are written on
  18.           standard output.
  19.  
  20.           _C_d_e_c_l'_s scope is intentionally small.  It doesn't help you
  21.           figure out storage classes or initializations.
  22.  
  23.      CCCCOOOOMMMMMMMMAAAANNNNDDDD LLLLAAAANNNNGGGGUUUUAAAAGGGGEEEE
  24.           There are four statements in the language.  The "declare"
  25.           statement composes a C type-declaration from a verbose
  26.           description.  The "cast" statement composes a C type-cast as
  27.           might appear in an expression.  The "explain" statement
  28.           decodes a C type-declaration, producing a verbose
  29.           description.  The "help" statement describes the others.
  30.  
  31.           The following grammar describes the language.  In the
  32.           grammar, words in "<>" are non-terminals, bare lower-case
  33.           words are terminals that stand for themselves.  Bare upper-
  34.           case words are other lexical tokens:  NOTHING means the
  35.           empty string; NAME means a C identifier; NUMBER means a
  36.           string of decimal digits; and NL means the new-line
  37.           character.
  38.  
  39.           <program>    ::= NOTHING
  40.                          | <program> <stat> NL
  41.           <stat>       ::= NOTHING
  42.                          | declare NAME as <decl>
  43.                          | cast NAME into <decl>
  44.                          | explain <cdecl>
  45.                          | help
  46.           <decl>       ::= array of <decl>
  47.                          | array NUMBER of <decl>
  48.                          | function returning <decl>
  49.                          | function ( NAME ) returning <decl>
  50.                          | pointer to <decl>
  51.                          | <type>
  52.           <cdecl>      ::= <cdecl1>
  53.                          | * <cdecl>
  54.           <cdecl1>     ::= <cdecl1> ( )
  55.                          | <cdecl1> [ ]
  56.                          | <cdecl1> [ NUMBER ]
  57.                          | ( <cdecl> )
  58.                          | NAME
  59.           <type>       ::= <typename> | <modlist>
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/21/87)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      CCCCDDDDEEEECCCCLLLL((((1111))))                  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV                  CCCCDDDDEEEECCCCLLLL((((1111))))
  71.  
  72.  
  73.  
  74.                          | <modlist> <typename>
  75.                          | struct NAME | union NAME | enum NAME
  76.           <typename>   ::= int | char | double | float
  77.           <modlist>    ::= <modifier> | <modlist> <modifier>
  78.           <modifier>   ::= short | long | unsigned
  79.  
  80.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  81.           To declare an array of pointers to functions like malloc(3),
  82.           do declare fptab as array of pointer to function returning
  83.           pointer to char The result of this command is char
  84.           *(*fptab[])() When you see this declaration in someone
  85.           else's code, you can make sense out of it by doing explain
  86.           char *(*fptab[])() The proper declaration for signal(2)
  87.           cannot be described in _c_d_e_c_l's language (it can't be
  88.           described in C either).  An adequate declaration for most
  89.           purposes is given by declare signal as function returning
  90.           pointer to function returning int The function declaration
  91.           that results has two sets of empty parentheses.  The author
  92.           of such a function might wonder where the parameters go.
  93.           declare signal as function (args) returning pointer to
  94.           function returning int provides the solution:  int
  95.           (*signal(args))()
  96.  
  97.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  98.           The declare statement tries to point out constructions that
  99.           are not supported in C.  Also, certain non-portable
  100.           constructs are flagged.
  101.  
  102.           Syntax errors cause the parser to play dead until a newline
  103.           is read.
  104.  
  105.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  106.           Section 8.4 of the C Reference Manual.
  107.  
  108.      BBBBUUUUGGGGSSSS
  109.           The pseudo-English syntax is excessively verbose.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/21/87)
  130.  
  131.  
  132.  
  133.